##cmake_minimum_required( VERSION 2.8 )
project("sablo")
find_package( Qt4 REQUIRED )
include( ${QT_USE_FILE} )
INCLUDE_DIRECTORIES(
    ${QT_INCLUDE_DIR}
    ${QT_QTSQL_INCLUDE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
    interfacoj

)

# генерируем деф файл
#check_include_file_cxx("src/def.h" HAVE_DEF)
set(INSTPREF ${CMAKE_INSTALL_PREFIX})
configure_file(kodo/def.h.in def.h)



set( sablo_H
)

set( sablo_SRCS
        kodo/main.cpp
)
set( UIS
)


qt4_wrap_ui(UIS_H ${UIS})

qt4_wrap_cpp( MOC_SOURCES ${sablo_H} )

#set( RESOURCES res.qrc )
qt4_add_resources( QRC_SOURCES ${RESOURCES} )

add_executable( sablo ${sablo_SRCS} ${MOC_SOURCES} ${UIS_H} ${QRC_SOURCES})

target_link_libraries( sablo ${QT_LIBRARIES} ${QT_QTSQL_LIBRARIES})

# install for linux
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
    set(sablodir ${CMAKE_INSTALL_PREFIX})
    set(sablodir_bin ${sablodir}/bin)
    install(TARGETS sablo DESTINATION ${sablodir_bin})
    
endif()
# install for mac os x
if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
    set(sablodir ${CMAKE_INSTALL_PREFIX})
    set(sablodir_bin ${sablodir}/bin)
    install(TARGETS sablo DESTINATION ${sablodir_bin})
    
endif()